#ifndef QUICKOPERATIONWIDGET_H
#define QUICKOPERATIONWIDGET_H

#include "quickOperationInterface.h"
#include <QWidget>
#include <QPainterPath>
#include <QPainter>
#include <QApplication>
#include <QTabWidget>
#include "shortcutpanel/shortcutpanelwidget.h"
#include "clipboard/sidebarclipboardplugin.h"
#include "../dbusmanager.h"
#include "../gsettingmanager.h"

#define QUICKOPERATION_HEIGHT 351
#define QUICKOPERATION_WIDTH  375

extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed);

class MainWidget;
class mainTabWidget;

class quickOperationWidget : public QObject, public quickOperationInterface
{
    Q_OBJECT
    Q_PLUGIN_METADATA(IID "org.ukui.sidebar-qt.plugin-iface.quickOperationInterface" FILE "quickOperation.json")
    Q_INTERFACES(quickOperationInterface)

public:
    explicit quickOperationWidget(QObject *parent = nullptr);

    MainWidget*            m_pMainWidget = nullptr;
    mainTabWidget*         m_pMainTabWidget = nullptr;          // 主界面
    shortcutPanelWidget*   m_shortcutPanelWidget = nullptr;     // 快捷操作面板界面
    SidebarClipboardPlugin* m_SidebarClipboardPlugin = nullptr;

    QHBoxLayout * m_quickOperLayout = nullptr;

    QLabel* m_shortcutPanelLabel;
    QLabel* m_clipboardLabel;

    //插件接口
    QWidget *getQuickOperationWidget() override;

private:
    void initTranslations();              // 初始化翻译文件

public slots:
    void updateTabWidget();
};

class MainWidget : public QWidget
{
public:
    MainWidget();
private:
    double      m_dtranSparency;
    void getTransParency();
    void setTransParency();

protected:
    void paintEvent(QPaintEvent *event);
};


class mainTabWidget : public QTabWidget
{
public:
    mainTabWidget();
private:

protected:
    void paintEvent(QPaintEvent *e);
};

#endif // QUICKOPERATIONWIDGET_H
